from pyautogui import *

from .main import *

if __name__ == '__main__':
    # points = locatePoints()
    # openButton = locateOpen()
    # redoButton = locateRedo()
    # redo()
    # tryConnect(0, 1, True)
    # redo()
    # moveTo(140, 464)
    # mouseDown()
    # moveTo(264, 464)
    # mouseUp()
    # moveTo(130, 950)
    # mouseDown()
    # sleep(0.2)
    # mouseUp()
    ss = screenshot()
    a = ss.getpixel((64, 268))
    b = ss.getpixel((187, 329))
    print(a)
    print(b)
    print(convertRGBToGray(*a))
    print(convertRGBToGray(*b))
    sx, sy = (64, 268)
    ex, ey = (187, 329)
    mx = (sx + ex) // 2
    my = (ey + ey) // 2
    print(mx, my)
    print(isRed(ss.getpixel((sx, sy))))
    print(isRed(ss.getpixel((ex, ey))))
    print(isRed(ss.getpixel((mx, my))))
    moveTo(sx, sy)
    sleep(2)
    moveTo(ex, ey)
    sleep(2)
    moveTo(mx, my)

